![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
resize-observer
Advanced tools
This library aims to be a faithful implementation and ponyfill of the Resize Observer draft. An optional polyfill option exists as well.
resize-observer
is available on NPM and Yarn:
> npm install resize-observer
> yarn add resize-observer
resize-observer
does not install itself by default. As such, you can import it like any other module:
import { ResizeObserver } from 'resize-observer';
const ro = new ResizeObserver(() => console.log('resize observed!'));
ro.observe(document.body);
resize-observer
provides a file that can be referenced from your browser that automatically installs ResizeObserver
on the global window
object. Both minified and non-minified versions exist, and are found in the package under the
dist/
directory:
<script src="/node_modules/resize-observer/dist/resize-observer.js"></script>
<script type="text/javascript">
const ro = new window.ResizeObserver(() => alert('Observing things is super cool!'));
/* use your ResizeObserver! */
</script>
A install
method is also provided to do the same within your own code:
import { install } from 'resize-observer';
install();
const ro = new window.ResizeObserver(() => alert('Observe all the things!'));
/* ... */
Note: Calling install
will always overwrite window.ResizeObserver
.
If you'd like to only install resize-observer
when it doesn't already exist,
you can add a simple check before calling install
:
import { install } from 'resize-observer';
if (!window.ResizeObserver) install();
/* ... */
resize-observer
is written in TypeScript.
The definition files are included in the package and should be picked up automatically.
[1.0.4] - 2021-11-29
window
context to be observed when mounted to the DOM of another window
context (#100)FAQs
An implementation and polyfill of the Resize Observer draft.
The npm package resize-observer receives a total of 135,298 weekly downloads. As such, resize-observer popularity was classified as popular.
We found that resize-observer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.